﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Data;
using System.ComponentModel;
using System.Data.SqlClient;

namespace StatisticLeague
{
    /// <summary>
    /// Interaction logic for Insert_window.xaml
    /// </summary>
    public partial class Insert_window : Window
    {

        private DBfacade facade = new DBfacade();
        public DataTable DTC;
        public DataTable DTR;
        public Insert_window()
        {
            InitializeComponent();
            string champ_query = "select Champion_id, Champion_name From Champions";
            string role_query = "select Role_id, Role_name From Roles";
            DTC = facade.DBview(champ_query);
            DTR = facade.DBview(role_query);

            cmbChampions.ItemsSource = ((IListSource)DTC).GetList();
            cmbRoles.ItemsSource = ((IListSource)DTR).GetList();

            cmbChampions.DisplayMemberPath = "[Champion_name]";
            cmbChampions.SelectedValuePath = "[Champion_id]";

            cmbRoles.DisplayMemberPath = "[Role_name]";
            cmbRoles.SelectedValuePath = "[Role_id]";
            
            
            DataContext = this;

            
        }

    
    

        
        
          

    }
}
